<template>
	<!-- 解锁缴款 -->
	<view class="jsjk">
		<view class="title">缴款解锁</view>
		<view class="jsxq">
			<uni-group  v-for="item in jsLists" :key="item.id" class="jkItem">

				<view class="item">
					<view class="name">税款缴纳方式</view>
					<view class="con">{{item.skjnfsmc}}</view>
				</view>
				<view class="item">
					<view class="name">电子税票号</view>
					<view class="con">{{item.dzsphm}}</view>
				</view>
				<view class="item">
					<view class="name">扣款日期</view>
					<view class="con">{{item.kjrq}}</view>
				</view>
				<view class="item">
					<view class="name">缴款金额</view>
					<view class="con">{{item.sjje}}</view>
				</view>
				<view class="btn">
					<button type="primary" size="mini" @click="ljjs(JSON.stringify(item))">立即解锁</button>
				</view>
			</uni-group>
		</view>
	</view>
</template>

<script>
	import {
		queryDjsJkxx,
		handleYhdjspz,
	} from "@/utils/common-api.js"
	export default {
		data() {
			return {
				jsjkData: {
					djxh: "",
					sbId: ""
				},
				jsLists: []
			}
		},
		onShow(){
		 this.jsjkData=JSON.parse(uni.getStorageSync("dqjData"));	
		 console.log(this.jsjkData)
		 this.cxkjsjklb() 
		},
		methods: { 
			// 查询可解锁缴款列表
			async cxkjsjklb() {
				let lists = await queryDjsJkxx({
					...this.jsjkData
				})
				if (lists.head.errorCode == "0" && lists.body) {
					this.jsLists = lists.body
					console.log(this.jsLists)
				}
			},
			async ljjs(val) {
				val=JSON.parse(val)
				let params={
					dzsphm:val.dzsphm,
					skssswjgDm:val.skssswjgDm
				}
			  let lists= await handleYhdjspz({...params})
			  if (lists.head.errorCode == "0" && lists.body=="Success") {
				  console.log(this.jsjkData)
					// this.cxkjsjklb()   
				  this.$commonCzwjs.goPage({url:"/pages/sfqj/dqjmx"})   
			  } else if(lists.head.errorCode != "0"){
					uni.showToast({
						title: '数据请求失败',
						icon: 'error',
						duration: 3000
					})
				}
			}
		}
	}
</script>

<style>
	.title {
		width: 100%;
		height: 80rpx;
		background: #3171d5;
		text-align: center;
		line-height: 80rpx;
		color: white;
	}

	.jsxq {
		width: 100%;
		font-weight: bold;
		font-size: 26rpx;
		font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
	}
    .jkItem{
		background: #ffffff;
		margin-top: 20rpx;
	}
	::v-deep .uni-group .uni-group__content {
		padding: 0;
	}

	.uni-group__content {
		padding: 0;
	}

	.jsxq .item {
		display: flex;
		padding: 20rpx 0;
	}

	.jsxq .item .name {
		width: 180rpx;
		color: #66666699;
		text-align: left;
		margin-right: 10rpx;
		padding-left: 20rpx;

	}

	.jsxq .item .con {
		color: #222222;
		text-align: left;
	}

	.btn {
		text-align: center;
		background: #ffffff;
		height: 100rpx;
		display: flex;
		align-items: center;
	}

	.btn uni-button {
		width: 590rpx;
		background-color: #3171d5;
		height: 70rpx;
		line-height: 70rpx;
	}

	/* #ifdef MP-WEIXIN */
	.btn button {
		width: 590rpx;
		background-color: #3171d5;
	}

	/* #endif */
</style>